<%--
  Created by IntelliJ IDEA.
  User: 12138
  Date: 2020/12/22
  Time: 23:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>无标题文档</title>
</head>


<body>
<div class="echarts" id="read_sum" style="height:300px; width:90%;" ></div>
<foRM name="insertForm"  id="registSubmit" hidden="true"  method="post" action="/QM_war_exploded/ReadZan">
    <!-- 下面这一句是获取JSP程序中传递过来的变量值 -->
    <input type="hidden" id="mc" name="mc" value="">
    <input type="submit" id="sub" value="提交" >
</form>
</body>



<script src="${pageContext.request.contextPath }/js/echarts.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/js/jquery.min.js"></script>
<script>
    alert($("#username").val())
    $("#mc").val($("#username").val())
/*
    $("#sub").click();*/
   // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('read_sum'));

    option = {
        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'cross',
                crossStyle: {
                    color: '#999'
                }
            }
        },
        toolbox: {
            feature: {
                dataView: {show: true, readOnly: false},
                magicType: {show: true, type: ['line', 'bar']},
                restore: {show: true},
                saveAsImage: {show: true}
            }
        },
        legend: {
            data: ['蒸发量']
        },
        xAxis: [
            {
                type: 'category',
                data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
                axisPointer: {
                    type: 'shadow'
                }
            }
        ],
        yAxis: [
            {
                type: 'value',
                name: '阅读量',
                min: 0,
                max:10000,
                interval: 1000,
                axisLabel: {
                    formatter: '{value} 次'
                }
            },
            {
                type: 'value',
                name: '点赞量',
                min: 0,
                max:10000,
                interval: 1000,
                axisLabel: {
                    formatter: '{value} 个'
                }
            }
        ],
        series: [
            {
                name: '阅读量',
                type: 'line',
                data: [3210, 3240, 4530,6760, 5670, 450,6540,4560,7450,6450,6560,260]
            },
            {
                name: '点赞量',
                type: 'line',
                data: [123, 2131, 2312,4534, 6744, 2134,5667,7889,6786,2314,5647,4563]
            }
        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
